package com.mcxx.modules.miniSalvation.order.service.read;

import com.mcxx.modules.base.service.read.AreaHelper;
import com.mcxx.modules.base.utils.QueryParamUtil;
import com.mcxx.modules.miniSalvation.family.param.ExpireFamilyParam;
import com.mcxx.modules.miniSalvation.order.dao.read.ExpireFamilyReadDao;
import com.mcxx.modules.miniSalvation.order.dto.ExpireFamilyDTO;
import com.mcxx.modules.miniSalvation.order.entity.ExpireFamilyEntity;
import com.yinhai.ta404.core.restservice.requestbean.PageParam;
import com.yinhai.ta404.core.restservice.resultbean.Page;
import com.yinhai.ta404.core.security.vo.UserAccountVo;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@TaTransactional(readOnly = true)
public class ExpireFamilyReadService {

    @Autowired
    private ExpireFamilyReadDao expireFamilyReadDao;
    @Autowired
    private AreaHelper areaHelper;


    public List<ExpireFamilyEntity> listAll() {
    	return expireFamilyReadDao.listAll();
    }



    public ExpireFamilyEntity getById(String id) {
    	return expireFamilyReadDao.getById(id);
    }


    public Page<ExpireFamilyDTO> listExecutionPlan(ExpireFamilyParam param, PageParam pageParam, UserAccountVo accountVo) {

        QueryParamUtil.setBaseParamValue(param,accountVo);


        expireFamilyReadDao.beginPager(pageParam);
        List<ExpireFamilyDTO> list = expireFamilyReadDao.listExecutionPlan(param);


        return expireFamilyReadDao.endPager(list);
    }
}
